*********************
*This file contains the code to generate 
*descriptive statistics for estimation sample reported in Table S2.2
*******************************

*MP-parliament unit of observation
use dataKR2, clear
drop if kantonsrat==16
*Reform intensity
gen RatioDM_kr18 = RatioDM*kr18
*Outcome, district controls and MP characteristics
global D = "RatioDM_kr18  JaAnteilRef lang_frac  relig_frac foreign_pop industry_share" 
global MP = "attend age mDeath  mWorker mFarmer mNR LeftParty FarmersParty"
tabstat $D $MP attend, stat(mean sd min max) col(stat) format(%9.2f)
*Between district variation in reform intensity (for Figure 2)
*sum RatioDM if kantonsrat==18, d

*MP-vote unit of observation
use dataKR1, clear
tabstat congruence, stat(mean sd min max) col(stat) format(%9.2f)

*Alternative congruence (majority of MPs)
drop if mReplacement == 1
collapse (mean) kantonsrat kr18 RatioDM congruence JaAnteilRef JaAnteilRefSq  foreign_pop relig_frac lang_frac  industry_share, by(vID wk18)
*Alternative congruence: does a majority of MPs vote in line with popular majority?
gen conmajmps = 0
replace conmajmps = 1 if congruence >= 0.5
tabstat conmajmps, stat(mean sd min max) col(stat) format(%9.2f)
